package com.bianmaba.activiti.listeners;

import com.bianmaba.activiti.service.process.ProcessService;
import org.activiti.engine.delegate.DelegateExecution;
import org.activiti.engine.delegate.ExecutionListener;
import org.activiti.engine.delegate.JavaDelegate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * @program: example-spring-boot-extend
 * @description:
 * @author: Chenjiabin
 * @create: 2019/9/19 10:55
 **/
@Component
public class ExecutionDelegateExpressionListener implements JavaDelegate, ExecutionListener {
    @Autowired
    private ProcessService processService;

    public ExecutionDelegateExpressionListener() {
        System.out.println("初始化监听");
    }

    @Override
    public void execute(DelegateExecution delegateExecution) {

        System.out.println("executionId：" + delegateExecution.getId() + " ActivitiListenner" + this.toString());
    }

    @Override
    public void notify(DelegateExecution delegateExecution) {
        System.out.println("executionId：" + delegateExecution.getId() + " ActivitiListenner" + this.toString());

    }
}
